<%@Page Language="VB"%>
<%@Import Namespace="System.Data" %>
<html><head>
<title>Reading Data into a 
DataSet from an XML File</title>
</head>
<body bgcolor="#ffffff">
<div id="outMessage" runat="server"></div><br />
<asp:datagrid id="dgrValues" runat="server" />
<script language="VB" runat="server">
Sub Page_Load()
   Dim objDataSet As New DataSet()
   Try
      Dim strVirtualPath As String = _
	Request.ApplicationPath & _
	"/XML-from-DataSet.xml"
      Dim strVSchemaPath As String = _
	Request.ApplicationPath & _
	"/Schema-from-DataSet.xsd"      
      objDataSet.ReadXMLSchema(Request.MapPath(strVSchemaPath))
      outMessage.InnerHTML = _
	"Reading file: <b><a href=" & _
	Chr(34) & strVSchemaPath & _
	Chr(34) & ">" & strVSchemaPath & _
	"</a></b><br />"

      objDataSet.ReadXML(Request.MapPath(strVirtualPath))
      outMessage.InnerHTML += _
	"Reading file: <b><a href=" & _
	Chr(34) & strVirtualPath & _
	Chr(34) & ">" & strVirtualPath & _
	 "</a></b>"
   Catch objError As Exception
      outMessage.InnerHTML = _
	"<b>* Error while reading disk file</b>.<br />" _
          	& objError.Message & "<br />" & _
	objError.Source & "<br />" & _
          	"Run the previous example to create the disk file"
      Exit Sub  

   End Try
    dgrValues.DataSource =objDataSet
   dgrValues.DataBind()  
End Sub
</script>
</body>
</html>
